/* enum */
import ComponentNameEnum from '@model/enum/ComponentNameEnum'
import { isArray, isFunction, isNotEmpty } from '@src/util/type'
/* vue */
import { ComponentInstance, computed, ComputedRef, defineComponent, PropType, reactive, Ref, ref, toRefs } from 'vue'

export type AuthTreeNodeContentProps = {
  node: Record<string, any>;
}

export interface AuthTreeNodeContentSetupState {
  
}

export enum AuthTreeNodeContentEventEnum {
  
}

export type AuthTreeNodeContentEmitsOptions = {
  input: () => void;
}

export type AuthTreeNodeContentInstance = ComponentInstance & AuthTreeNodeContentSetupState
export type AuthTreeNodeContentVM = AuthTreeNodeContentSetupState & AuthTreeNodeContentProps & ComponentInstance

export default defineComponent({
  name: ComponentNameEnum.AuthTreeNodeContent,
  emits: [],
  props: {
    node: {
      type: Object,
      default: () => ({})
    }
  },
  setup(props: AuthTreeNodeContentProps, { slots, emit }) {
    
  },
  render(h) {
    
    const nodeRender = this.node?.nodeRender as Function
    
    if (isFunction(nodeRender)) {
      return nodeRender(h, this.node)
    }
    
    return (
      <div class={ComponentNameEnum.AuthTreeNodeContent}>
        <span>
          { this.node?.name }
        </span>
      </div>
    ) as any
  }
}) as any
